<template>
	<view class="container">
		<!-- <view class="status_bar"></view> -->
		<!--公司信息-->
		<!-- <view class="company flex-row">
			<view class="left flex-row">
				<view class="type">企</view>
				<text class="name">公司名称</text>
			</view>
			<view class="right"></view>
		</view> -->
		<!--公告-->
		<!-- <view class="notice flex-row">
			<uni-icons type="sound" color="#1793D4" size="16"></uni-icons>
			<swiper :autoplay="notice.autoplay" :interval="notice.interval" :duration="notice.duration" :circular="notice.circular">
				<swiper-item v-for="item in notices" :key="item.id">{{ item.name }}</swiper-item>
			</swiper>
		</view> -->
		<!--轮播-->
		<!-- <view class="slider">
			<swiper :autoplay="slider.autoplay" :interval="slider.interval" :indicator-dots="slider.showIndicatorDots" :indicator-active-color="slider.indicatorActiveColor">
				<swiper-item v-for="item in sliders" :key="item.id">
					<image :src="item.src"></image>
				</swiper-item>
			</swiper>
		</view> -->
		<!--员工-->
		<!-- <view  class="employee flex-row" @click="toPage('taskBoard')">
			<view class="left">
				<image :src="userInfo.avatar"></image>
				<text>{{ userInfo.name }}</text>
			</view>
			<view class="right">
				<view class="item">
					<view>部门：{{ userInfo.zhiwu }}</view>
					<view>未巡检：共<text class="uncheck">{{ userInfo.notCheck }}</text>条</view>
				</view>
				<view class="item">
					<view>级别：部门{{ userInfo.level }}级</view>
					<view>待整改：共<text class="checking">{{ userInfo.notCheck }}</text>条</view>
				</view>
				<view class="item">
					<view>网格：直属{{ userInfo.cycle }}人</view>
					<view>待验收：共<text class="checked">{{ userInfo.notYanshou }}</text>条</view>
				</view>
				<image src="../../static/fengxianxuncha/arrow-r.png" mode=""></image>
			</view>
		</view> -->
		<!--入口-->
		<view class="entry" style="padding-top: 40upx;">
			<view v-for="(item, index) in entries" :key="index" @click="toPage(item.url)" class="item flex-column">
				<image :src="item.img"></image>
				<text>{{ item.name }}</text>
			</view>
		</view>
	</view>
</template>

<script>
import uniIcons from '../../components/uni-icons/uni-icons.vue';
export default{
	components: { uniIcons },
	data(){
		return {
			// 公告参数配置
			notice: {
				autoplay: true,
				circular: true,
				interval: 5000,
				duration: 15000
			},
			// 公告内容
			notices: [
				{id: 1, name: '这是一段文本标题这是一段文本标题这是一001'},
				{id: 2, name: '这是一段文本标题002'},
				{id: 3, name: '这是一段文本标题003'},
				{id: 4, name: '这是一段文本标题004'}
			],
			// 轮播参数配置
			slider: {
				indicatorActiveColor: '#0596EC',
				showIndicatorDots: true,
				autoplay: false,
				interval: 3000,
			},
			// 轮播列表
			sliders: [
				{id: 1, src: 'http://img2.imgtn.bdimg.com/it/u=3041974687,1312568471&fm=26&gp=0.jpg'},
				{id: 2, src: 'http://img4.imgtn.bdimg.com/it/u=4047717572,2067067998&fm=26&gp=0.jpg'}
			],
			// 员工信息
			userInfo: {
				avatar: '/static/fengxianxuncha/user.png',
				name: '名称',
				zhiwu: '职务',
				notCheck: 0,
				notDone: 0,
				notYanshou: 0,
				level: 0,
				cycle: 0
			},
			// 入口列表
			entries: [
				{name: '风险管控', url: '../riskEvaluation/riskLook', img: '../../static/img/home/control.png'},
				{name: '隐患治理', url: '../huihuandeweizhi/dangerHandle', img: '../../static/img/home/danger.png'},
				{name: '网格责任', url: '../grid/index', img: '../../static/img/home/grid.png'},
				{name: '教育培训', url: '../education/index', img: '../../static/img/home/edu.png'},
				{name: '作业票', url: '../jobTicket/index', img: '../../static/img/home/homework.png'},
				{name: '信息共享', url: '../infoShare/index', img: '../../static/img/home/datashare.png'},
				{name: '预警提醒', url: '../riskEvaluation/riskAlarm', img: '../../static/img/home/alarm.png'},
				{name: '在线监测', url: '', img: '../../static/img/home/online.png'},
				{name: '应急管理', url: '../emergency/index', img: '../../static/img/home/manage.png'},
			]
		}
	},
	onShow(){
		if(!uni.getStorageSync('userid')){
			uni.reLaunch({
				url: '../login/login'
			})
		}
	},
	onHide(){
		// #ifdef APP-PLUS
		/* 隐藏凸起图标 */
		var icon = plus.nativeObj.View.getViewById("icon");
		setTimeout(function() {
			if(icon){icon.hide();}
		}, 100);
		// #endif
	},
	methods: {
		// 页面跳转
		toPage(url){
			if(url){
				uni.navigateTo({url});
			}else{
				uni.showToast({
					icon: 'none',
					title: '此功能暂未开放'
				})
			}
		}
	}
}
</script>

<style scoped>
.status_bar{
	width: 100%;
	height: var(--status-bar-height);
	background: #fff;
}
/*入口*/
.entry{
	overflow: hidden;
}
.entry .item{
	float: left;
	width: calc((100% - 60upx) / 3);
	margin-bottom: 10upx;
}
.entry .item:nth-child(3n-1){
	margin: 0 30upx 10upx;
}
.entry .item image{
	width: 180upx;
	height: 120upx;
}
.entry .item text{
	font-size: 28upx;
}

/*头部信息*/
.employee{
	height: 130upx;
	padding: 20upx;
	background: #fff;
	margin: 0 20upx 30upx;
	border-radius: 16upx;
	border: 2upx solid #F6F6F6;
	box-shadow: 0 0 4upx #eee;
}
.employee .left{
	width: 140upx;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
.employee .left image{
	width: 80upx;
	height: 80upx;
	border-radius: 50%;
	margin: 10upx auto 10upx;
}
.employee .left text{
	color: #444;
	font-size: 28upx;
	font-weight: bold;
	overflow: hidden;
}
.employee .right{
	width: calc(100% - 160upx);
	position: relative;
}
.employee .right image{
	width: 16px;
	height: 30px;
	position: absolute;
	right: -10upx;
	top: 45upx;
}
.employee .right .item{
	display: flex;
	align-items: center;
}
.employee .right .item:nth-child(2){
	margin: 2upx 0;
}
.employee .right .item view:first-child{
	width: 55%;
}
.employee .right .item view:last-child{
	width: 40%;
}
.employee .right .item view{
	margin-right: 2%;
	font-size: 26upx;
}
.employee .right .item text{
	margin: 0 4upx;
}
.employee .right .item .uncheck{
	color: orange;
}
.employee .right .item .checking{
	color: red;
}
.employee .right .item .checked{
	color: green;
}

/*轮播*/
.slider{
	margin: 20upx;
}
.slider swiper{
	height: 200upx;
}
.slider image{
	width: 100%;
	height: 100%;
	border-radius: 20upx;
}

/*公告*/
.notice{
	height: 60upx;
	line-height: 60upx;
	margin: 0 20upx;
	padding: 0 20upx;
	background: #C4E5F8;
	font-size: 32upx;
	border-radius: 10upx;
}
.notice swiper{
	width: calc(100% - 40upx);
	height: 60upx;
	line-height: 60upx;
	overflow: hidden;
}

/*公司信息*/
.company{
	height: 100upx;
	line-height: 100upx;
	padding: 0 20upx;
	background: #fff;
}
.company .type{
	color: #fff;
	padding: 0 10upx;
	font-size: 22upx;
	background: #1793D4;
	border-radius: 10upx;
}
.company .name{
	color: #333;
	font-size: 32upx;
	font-weight: bold;
	margin-left: 10upx;
}

.container{
	height: 100vh;
	background: #fff;
}
</style>
